//
//  ReaderToolBar.h
//  ebook
//
//  Created by 吴超飞 on 16/1/15.
//  Copyright © 2016年 Moton. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "FontSetView.h"
#import "PageStyleView.h"
#import "DownloadView.h"
#import "ReaderBookModel.h"

@class ReaderToolBar;
@class Chapter;
@class Bookmark;

@protocol ReaderToolBarDelegate <NSObject>

-(void)readerToolBar:(ReaderToolBar *)bar fontsizeSet:(NSInteger)fontsize;
-(void)readerToolBar:(ReaderToolBar *)bar backgroudColor:(ReadBackgroud)bgcolor;
-(void)readerToolBar:(ReaderToolBar *)bar linespace:(CGFloat)space;
-(void)readerToolBar:(ReaderToolBar *)bar setBtnClick:(NSInteger)btnTag;

-(void)readerToolBar:(ReaderToolBar *)bar changePageStyle:(PageTurnStyle)style;
-(void)readerToolBar:(ReaderToolBar *)bar orientationIsLandscape:(BOOL)isLandscape;
-(void)readerToolBar:(ReaderToolBar *)bar autoReadingBtnClick:(UIButton *)btn;

-(void)readerToolBar:(ReaderToolBar *)bar setIsNight:(BOOL)isnight;

-(void)readerToolBar:(ReaderToolBar *)bar selectedChapter:(Chapter *)chapter;
-(void)readerToolBar:(ReaderToolBar *)bar isShowBookmarkMenuView:(BOOL)show;

-(void)readerToolBar:(ReaderToolBar *)bar downloadType:(DownloadType)downloadType;
-(void)readerToolBar:(ReaderToolBar *)bar downloadCancel:(BOOL)cancel;//取消下载

@end

@class ReaderBookModelViewController;

@interface ReaderToolBar : UIView

@property (nonatomic,weak  ) id<ReaderToolBarDelegate> delegate;
@property (nonatomic,assign) BOOL isNight;
@property (nonatomic,retain) DownloadView *downloadView;

-(instancetype)initWithDataController:(ReaderBookModel *)readerbookModel;
//设置总页数
-(void)setTotoalPages:(NSInteger)totoal;
//设置当前显示的页数
-(void)setCurrentPage:(NSInteger)page;

-(void)addToView:(UIView *)parentView;//加入父视图，并且默认不显示
-(BOOL)isSHow;
-(void)hide;
-(void)show;

-(BOOL)isShowSubview;//是否有子视图(字体设置、背景选择)显示
-(void)hideSubview;//收起子视图（字体设置、背景选择）
-(BOOL)isDownloadViewShow;

-(void)cancelDownload;//取消下载
-(void)setProgressPercent:(float)progress exist:(BOOL)exist;//下载进度
-(void)showWaitDownload;//等待下载

-(void)performSelectNightMode;//模拟点击夜间按钮

-(void)didReceiveMemoryWarningOperator;


@end
